package com.xc.hotelmgr.datapusherali.controller;

import com.xc.hotelmgr.datapusherali.pojo.mq.RatesCallBack;
import com.xc.hotelmgr.datapusherali.pojo.request.PsMap;
import com.xc.hotelmgr.datapusherali.service.fz.RatesService;
import com.xc.hotelmgr.datapusherali.service.mybatis.HtLogicRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/daily_room")
public class FzDailyRoomController {

    @Autowired
    private RatesService ratesService;

    @RequestMapping(value = "send_rates/{store_id}/{room_code}/{rp_code}",method = RequestMethod.GET)
    public String sendRates(@PathVariable(name = "store_id") int store_id, @PathVariable(name = "rp_code") String rp_code, @PathVariable(name = "room_code") String room_code){
//        String result = htRateplanService.selectRpRs(store_id,room_code,rp_code);
//        return result;
        return null;
    }

    @RequestMapping(value = "pushRates",method = RequestMethod.POST)
    public String pushRates(@RequestBody PsMap psMap){
     return "ok";
    }

    @RequestMapping(value = "hotelRatesSend",method = RequestMethod.POST)
    public String hotelRatesSend(@RequestBody RatesCallBack ratesCallBack) throws InterruptedException {
        ratesService.hotelRatesSend(ratesCallBack);
        return "ok";
    }
}
